In recent years, energy harvesting technology which harvests ambient small energy and provides power is attracting interest. A thermoelectric generator which uses heat as an energy source comprises a thermoelectric element for converting heat energy into electric energy, and a DC to DC converter for converting an input voltage from the thermoelectric element into a voltage of a desired level. To maximize the output power of the DC to DC converter, the output voltage of the thermoelectric element is set at a value which is half the open voltage (electromotive force) of the thermoelectric element. This technique, however, does not consider the effect caused by the parasitic resistance of the DC to DC converter, and the output power of the DC to DC converter is not necessarily maximized.